package com.liyue.threadlib;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Created by Ly
 * on 2021/7/14
 */
public class ThreadPool {
    public static ThreadFactory threadFactory=new ThreadFactoryBuilder().setNameFormat("ThreadLib-pool-%d").build();
    public static ExecutorService executorService =new ThreadPoolExecutor(5,10,10, TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>(1024),threadFactory,new ThreadPoolExecutor.AbortPolicy());

}
